package ute.mvc.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import ute.mvc.model.MyClass;
import ute.mvc.model.OpenCourse_Subject;
import ute.mvc.model.TestAndQuizz;
@Repository("course_subjectDAO")
public class Course_SubjectDAOImpl implements Course_SubjectDAO{
	@Autowired
	SessionFactory sessionFactory;

	public void addCourse_Subject(OpenCourse_Subject course_subject) {
		sessionFactory.getCurrentSession().save(course_subject);
	}

	public void updateCourse_Subject(OpenCourse_Subject course_subject) {
		sessionFactory.getCurrentSession().merge(course_subject);
	}

	public void deleteCourse_Subject(OpenCourse_Subject course_subject) {
		sessionFactory.getCurrentSession().delete(course_subject);
	}

	public OpenCourse_Subject getCourse_Subject(String id) {
		// TODO Auto-generated method stub
		return (OpenCourse_Subject) sessionFactory.getCurrentSession().get(OpenCourse_Subject.class, id);
	}

}
